package app.keter.secruity.encoder;

import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.crypto.password.StandardPasswordEncoder;

/**
 * Created by gkatzioura on 10/5/16.
 */
public class SHAEncoder implements PasswordEncoder {
	
	StandardPasswordEncoder encoder = new StandardPasswordEncoder("secret");

    @Override
    public String encode(CharSequence rawPassword) {
        String hashed = encoder.encode(rawPassword);
        return hashed;
    }

    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return encoder.matches(rawPassword, encodedPassword);
    }


}
